#ifndef __TYPES_H__
#define __TYPES_H__

/*******************************************************************************
    Project: JobShop Problem using Genetic Algorithm: Serial Approach
    File: types.h
    Author: Ameya Deswandikar
    Email: ameya.des1@gmail.com
    Revision: 0.1
    Date & Time: 11/08/2013

    Description:
    This file contains the custom data types used in the program
*******************************************************************************/

/*
** ----------------------------------------------------------------------------
** S Y S T E M   I N C L U D E S
** ----------------------------------------------------------------------------
*/
#include <string>
using namespace std;


/*
** ----------------------------------------------------------------------------
** C O N F I G U R A T I O N   P A R A M E T E R S
** ----------------------------------------------------------------------------
*/
// If defined, debug prints will be visible on stdout
//#define __debug__

// The maximum number of allowed generations. GA may converge earlier
#define NUM_GENERATIONS (10)

// Maximum number of threads
#define MAX_THREADS	(32)



/*
** ----------------------------------------------------------------------------
** C U S T O M   D A T A   T Y P E S
** ----------------------------------------------------------------------------
*/

/*
 * Data Structure for Individual
 */
struct Individual
{
    // The chromosome representation
	string Chromosome;

	// The fitness
    float Fitness;
};

/*
 * Data Structure for Evaluating individual
 */
typedef struct _evalIndArg {
	Individual* universe;
	unsigned int jobs;
	unsigned int machines;
	unsigned int ***T1;
	unsigned int ***P1;
	long int tid;

}evalIndArg ;

/*
 * Enum to keep track for random seeds
 */

typedef enum _rand_seeds  {
		RS_CR_NEW_POP_X = 0,
		RS_CR_NEW_POP_Y,
		RS_GET_RAND_CHAR,
		RS_ROULETTE,
		RS_CROSSOVER,
		RS_MAX_RAND_SEEDS

}RAND_SEED;

/*
 * Data Structure for a gene in a chromosome
 */
typedef struct _gene
{
	// Name of the individual gene
	char name;

	// The relative position, with respect to a similar
	// type of gene in the chromosome i.e. A1 A3 etc.
	unsigned int pos;

	// Is it available for deletion during crossover
	// and mutation ?
	bool canDelete;
}gene;

/*
 * Arugment Structure for passing to threads
 */

typedef struct {
  	Individual* NewPopulation;
  	Individual* SortedPopulation;
   	int jobs;
   	int machines;
   	long int tid;
}cs_arg_struct;


#endif // __TYPES_H__
